package test.ssh;

import org.junit.BeforeClass;
import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import keter.framework.util.ssh.SshUtil;

public class SshBatch {

	/**
	 * Logger for this class
	 */
	private static final Logger logger = LoggerFactory.getLogger(SshBatch.class);
	
	static SshUtil[] ssh = new SshUtil[30];
	
	@BeforeClass
	public static void clean() throws Exception {
		for (int i = 10; i <= 24; i++) {
			ssh[i] = SshUtil.init("10.51.50."+i,"root","abcd123!@#");			
		}
	}
	
	@Test
	public void trans() throws Exception {
		for (int i = 10; i <= 24; i++) {
			String name = ssh[i].exec("echo $HOSTNAME").result();
			String logo = "0715-2";
			ssh[i].download("/opt/nmondata/"+name.replace("\n", ".")+logo+".nmon", "e:/temp/sipo/nmondata/0715/");	
		}
		
	}
}
